home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / misc / emu / uniq.lha / uniq.doc < prev    next >
Encoding:
Text File  |  1994-04-03  |  4.4 KB  |  138 lines

  1.                                 Uniq V1.02
  2.                         Written by Oliver Kaufmann
  3.                         Released on April 1,  1994
  4.  
  5.  
  6.      This program is Freeware. Copyright 1994 by Oliver Kaufmann.
  7. All Rights Reserved.  UNIQ is freely distributable, but the author retains all
  8. rights in regards to the program.  Permission is granted to distribute this
  9. program for a minimal charge (for copying, handling, etc.).
  10.      Use this program at your own risk,  no warranties will be made.
  11.  
  12.  
  13.      UNIQ is a Shell-command primarily designed to make life easier with file
  14. name length convention on different file systems such as MSDOS, but it is not
  15. limited to that. UNIQ takes its input either from stdin or from the contents
  16. of a specified directory. Its output will give those (file) names that do not
  17. comply with the requested name length followed by a "UNIQified" name, which
  18. is unique to the entire input. Thus it is easy to have those files renamed to
  19. properly comply with the destination filing system name length convention.
  20.  
  21.  
  22.  
  23. 1. INSTALLATION
  24. ---------------
  25.  
  26. Copy UNIQ to any directory you like that is in your path.
  27.  
  28.  
  29.  
  30. I. USAGE
  31. --------
  32.  
  33. uniq [-d[<dir>]] [-a] [-f] [-l<lformat>] [-p<pattern>] [-b<blen>] [-e<elen>]
  34.             -d<dir> : use contents of <dir> as input, otherwise use stdin
  35.                  -a : print all names, even those which do not change
  36.                  -f : process files only, no dirs (requires -d option)
  37.         -l<lformat> : use <lformat> for formated output ("rename %s %s")
  38.         -p<pattern> : pattern to apply (default #?)
  39.            -b<blen> : max. length of the uniqified string (default 8)
  40.            -e<elen> : max. length of the uniqified extension (default 3)
  41.  
  42.  
  43.  
  44. II. WHAT IS IT FOR
  45. ------------------
  46.  
  47. Suppose you've got a lot of pictures taken from internet news, let's say
  48. alt/binaries/pictures. Usually no problem for the Amiga, but possibly a
  49. firend of yours, who's only got a PC running MSDOS, wants to get the
  50. pictures from you. The problem is that some file names are too long for
  51. MSDOS, 8 + 3 = 11 chars max file name length. Even worse many pics do have
  52. allmost the same names except for the last character. If you copy such files
  53. to a MSDOS floppy or harddisk, you will probably get only one out of several.
  54. You may rename them by hand, but that's quite annoying, especially if there
  55. are over 1200 pics in that directory. Now you probably know what UNIQ might
  56. be used for.
  57.  
  58.  
  59. III. HOW IT WORKS
  60. -----------------
  61.  
  62. UNIQ takes its input, applies the pattern, checks the matched input for
  63. consistency with the (specified) length and, if necessary, prints a list of
  64. source names along with their corresponding UNIQified names. The unique
  65. names will be derived from the source names, modified and attached numbers,
  66. while the extension will be preserved, maybe truncated. By default UNIQ
  67. prints 'rename <source file> <unique file>' to stdout. You may redirect
  68. the output to a file and execute it afterwards to have the job done.
  69. Remember that by default UNIQ reads from stdin. If you want to use a
  70. directory as input you have to apply the -d switch (-d is the current,
  71. -d<dir> is any you specify). No path will be printed. Be aware that all
  72. arguments to switches must be directly typed after the switch, no spaces
  73. in between. If reading from stdin without redirection you finish typing by
  74. pressing CTRL-\ twice.
  75.  
  76.  
  77. IV. EXAMPLES
  78. -------------
  79.  
  80. Let's have UNIQ examine the contents of the current directory and list all
  81. files which do not comply with the (default) MSDOS name length convention.
  82. Look at that:
  83.  
  84. :> uniq -d
  85.  
  86. Now you can do
  87.  
  88. :> uniq -d >ram:test.bat
  89. :> execute ram:test.bat
  90.  
  91. If you don't want to rename the files you can copy them (see the -a for all)
  92. Let's say msd: is the MSDOS DISK
  93.  
  94. :> uniq -d -a -l"copy %s msd:%s" >ram:test.bat
  95. :> execute ram:test.bat
  96.  
  97. Or read from stdin
  98.  
  99. :> uniq -l"this is not uniq: %s should be %s" <testfile.idx
  100.  
  101.  
  102.  
  103. 2. Inspiration
  104. --------------
  105.  
  106. This Program was written, because I had to transfer about 400MB of data
  107. gathered from UNIX to a MSDOS harddisk.
  108.  
  109.  
  110.  
  111. 3. Misc
  112. -------
  113.  
  114. This program is far from complete and has not been tested too much, but it
  115. works for me.
  116.  
  117.  
  118. 4. Source
  119. ---------
  120.  
  121. I've included the source code. Everybody may use it, implement other
  122. features etc. as long as the author is mentioned.
  123.  
  124.  
  125.  
  126. 5. The Author
  127. -------------
  128.  
  129.      Oliver Kaufmann
  130.      Eserwallstrasse 8
  131.      86159 Augsburg
  132.      Germany                e-mail: kaufmano@informatik.tu-muenchen.de
  133.  
  134.  
  135.  
  136.  
  137. DISCLAIMER:  Use this program at your own risk.
  138.